$(function () {
    var t = sessionStorage.getItem("uid");
    t || (console.error("uid not exist"), location.hash = "login"),
        $("#restPass").on("click",
            function () {
                var s = $("#phone_num").val();
                s && /1\d{10}/.test(s) ? $.ajax({
                    method: "post",
                    url: hostUrl + "/customer/resetPass",
                    contentType: "application/json; charset=utf-8",
                    data: JSON.stringify({
                        'type': 2,
                        "mobile": s
                    }),
                    success: function (t) {
                        !0 !== t.meta.success ? $.toptip(t.meta.message, "error") : ($.toptip("重置密码的密码已发送到您的手机上，请查收！", "success"), setTimeout(function () {
                            location.hash = "pass-manage"
                        },
                            1e3))
                    }
                }) : $.toptip("请输入11位手机号")
            })
});